<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="my" uri="/my-tags" %>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'managerList.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	
	<link rel="stylesheet" type="text/css" href="images/main.css">
	<link rel="stylesheet" type="text/css" href="images/pagingExt.css">

<script type="text/javascript" src="images/jquery.js"></script>
<script type="text/javascript" src="images/jquery.md5.js"></script>
	<script type="text/javascript">
		$(function(){
			$("tr").mouseleave(function(){
				$(this).css("background-color","#fefefe");
				$("thead tr").css("background-color","#F3F8F7");
			});
			$("tr").mouseover(function(){
				$(this).css("background-color","#E9E9E4");
				$("thead tr").css("background-color","#F3F8F7");
			});
		});
	function resetPwd(id){
		if( confirm('确认重置密码为012345?')){
		$.ajax({
			url:"resetPwd",
			data:{id:id},
			type:'POST',
			success:function(data){
				alert(data);
				window.location.reload();
			}
		});
	}
	};
</script>

  </head>
  
  <body>
    <div class="mainBox">
    	<table class="table_list" cellpadding="3" cellspacing="1" border="0"><s:property value=""/>
    	<thead><tr style="background:#F3F8F7"><td>序号</td><td>登录名</td><td>用户名称</td><td>用户类型</td><td>创建时间</td><td>最后登录时间</td><td>是否启用</td><td colspan="3">操作</td></tr></thead>
    	
    	<s:iterator value="#session.SESSION_MANAGER_LIST" var="each" status="st">
    		<tr style="background:#fefefe">
    		<td><s:property value="#st.index + 1"/></td>
    		<td><s:property value="#each.manLoginName"/></td>
    		<td><s:property value="#each.manName"/></td>
    		<td><s:property value="#each.manType.manTypeName"/></td>
    		<td><s:property value="#each.manCreateTime"/></td>
    		<td><s:property value="#each.manLastLoginTime"/></td>
    		<td>
    		<s:if test="#each.manState == 0">未启用</s:if>
    		<s:else>已启用</s:else>
    		<td><a href="queManager?id=<s:property value="#each.manId"/>">修改</a></td>
    		<td><a onclick="resetPwd(<s:property value='#each.manId'/>);">重置密码</a></td>
    		<td><a href="delManager?id=<s:property value="#each.manId"/>" onclick="return confirm('此操作不可恢复,是否继续?');">删除</a></td>
    		</tr>
    	</s:iterator>
    	
    		<tr style="background:#fefefe"><td colspan="99" align="right">
<my:page pageSize="${sessionScope.SESSION_MANAGER_PAGESIZE }" pageNo="${sessionScope.SESSION_MANAGER_PAGENO }" url="listManager" count="${sessionScope.SESSION_MANAGER_COUNT }"></my:page>
    		</td></tr>
    	</table>
    	
    </div>
  </body>
</html>
